Why You Should Use Routines...Routinely

نویسنده

  • Steve McConnell
چکیده

As an undergraduate computer science student, I thought that the main reason to create new routines, instead of leaving all the code in one big routine, was to avoid duplicate code. This is undoubtedly the most popular reason for creating a routine, and it’s a good one. Similar code in two routines is a warning sign. David Parnas says that if you use copy and paste while you’re coding, you’re probably committing a design error. Instead of copying code, move it into its own routine. Future modifications will be easier because you will need to modify the code in only one location. The code will be more reliable because you will have only one place in which to be sure that the code is correct. That is one good reason to create a routine, but it hardly makes a complete list.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Dumb = Fast for Polynomial Multiplication . Or , You have Plenty of Memory . Use Some .

We’ve read (and written) papers on how to write programs for multiplying polynomials, but a simple fact seems to have eluded some researchers, and we have not really emphasized it enough. Here it is: By using some extra memory you can simplify the program so much that it is very fast and hard to beat with any more sophisticated method. We explain why a very simple program is so fast that it pro...

متن کامل

Rehabilitation Services: Why should we use Tele-rehabilitation in IRAN? (Necessity and Application)

People living in rural areas far from health care centers are more likely to require health care services due to their long distances services and poverty(1). Tele-rehabilitation is considered as one of the rapidly emerging and growing areas of telemedicine and a precious model for providing clinical services like assessment, treatment and follows up as well as reducing the length of time for h...

متن کامل

A course in linear algebra with applications

Why should wait for some days to get or receive the a course in linear algebra with applications book that you order? Why should you take it if you can get the faster one? You can find the same book that you order right here. This is it the book that you can receive directly after purchasing. This a course in linear algebra with applications is well known book in the world, of course many peopl...

متن کامل

Qualitative reasoning - modeling and the generation of behavior

Why should wait for some days to get or receive the qualitative reasoning modeling and the generation of behavior book that you order? Why should you take it if you can get the faster one? You can find the same book that you order right here. This is it the book that you can receive directly after purchasing. This qualitative reasoning modeling and the generation of behavior is well known book ...

متن کامل

Fulfilling the promise of evidence-based medicine.

Why should wait for some days to get or receive the fulfilling the promise of evidence based medicine book that you order? Why should you take it if you can get the faster one? You can find the same book that you order right here. This is it the book that you can receive directly after purchasing. This fulfilling the promise of evidence based medicine is well known book in the world, of course ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • IEEE Software

دوره 15  شماره 

صفحات  -

تاریخ انتشار 1998